<?php 
    $dropdown_data= array(
    'table_name'=>'animus_sub_region',
    'key_field'=>'id',
    'value_field'=>'name'
    );

    $dropdown_annonce_level= array(
    'table_name'=>'animus_anounce_level',
    'key_field'=>'id',
    'value_field'=>'name'
    );

    $dropdown_users= array(
    'table_name'=>'lehu_users',
    'key_field'=>'id',
    'value_field'=>'username'
    );

?>
<div id="wrapper-content">
    <?php $this->load->view('admin/annonce/user_selector');
        $user_id = isset($user_id)?$user_id:0;    
    ?>
    <table class="titrepage" width="100%">
        <tr>
            <td >Add Annonce</td>
            <td align="right"> </td>
        </tr>
    </table>
    <?php echo form_open_multipart('animus_admin/add_new_annonce') ?>
    <table width="100%" class="list">
        <tr>
            <td width="30%" >User Post :</td>
            <td>
            <p>
                <input id="user_id" type="hidden" name="user_id" value="<?php echo $user_id?>"/>
                <input id="user_email" name="user_email" type="text" value="<?php echo set_value('user_email');?>"/>
                <?php echo form_error('user_email')?>
            </p>
            </td>
        </tr>

        <tr>
            <td width="30%" >Title :</td>
            <td><input type="text" name="title" size="30" value="<?php echo set_value('title')?>"/></td>
            <td><?php echo form_error('title'); ?></td>
        </tr>
        <tr>
            <td><label >Images :</label></td>
            <td><input type="file" name="userfile" id="userfile" size="25"/></td>
        </tr>
        <tr>
            <td width="30%" >Description:</td>
            <td><textarea rows="10" cols="50" name="description" size="30" value="<?php echo set_value('description')?>"></textarea></td>
            <td><?php echo form_error('description'); ?></td>
        </tr>
        <tr>
            <td width="30%" >Content :</td>
            <td>
                <?php
                    $data = array(
                    'name' => 'content',
                    'id' => 'content',
                    'width' => '550',
                    'height' => '400'
                    );
                    echo form_fckeditor($data);
                ?>
            </td>
            <td><?php echo form_error('content'); ?></td>
        </tr>

        <tr>
            <td width="30%" >Expried date :</td>
            <td>
                Day :<?php echo $expried_date['day'];?>  Month :<?php echo $expried_date['month'];?>  Year :<?php echo $expried_date['year'];?>    
            </td>
        </tr>

        <tr>
            <td width="30%" >Sub-Region :</td>
            <td>
                <?php echo form_dropdown('sub_reg',dropdown_data($dropdown_data),'1');?>
            </td>
        </tr>

        <tr>
            <td width="30%" >Annonce Type :</td>
            <td>
                <?php echo form_dropdown('sub_reg',dropdown_data($dropdown_annonce_level),'1');?>    
            </td>
        </tr>

        <tr>
            <td width="30%" >Active :</td>
            <td>
                <?php echo $is_active; ?>    
            </td>
        </tr>

        <tr>
            <td><input type="submit" name="btn_add_annonce", id="btn_add_annonce" value = "Add new"/> </td>
        </tr>
    </table>


</div>

